package rp.account;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import utils.COLOR;
import utils.JDBC;
import utils.UTIL;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CMDAccount implements CommandExecutor {
    private Map<String, Boolean> conf;
    private JDBC jdbc;

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
        boolean isAdmin = sender.hasPermission("minecraft");
        boolean isPlayer = sender instanceof Player;
        Player player = isPlayer ? (Player) sender : null;
        Player target = null;

        switch (getCmd(args[0])) {
            case "":
                break;
        }
        return true;
    }

    private String getCmd(String str) {
        List<String[]> list = new ArrayList() {{
            add(new String[]{"l", "login"});
            add(new String[]{"suf", "suffix"});
        }};
        for (String[] strs : list)
            if (UTIL.CHECK(str, strs))
                return strs[strs.length - 1];
        return "";
    }

    public CMDAccount() {
    }

    public CMDAccount(FileConfiguration config) {
        this.conf = new HashMap() {{
        }};
    }

    public CMDAccount(JavaPlugin plugin, FileConfiguration config,JDBC jdbc) {
        this(config);
        //plugin.getCommand("r").setTabCompleter(new CMPGroup());
        Bukkit.getPluginManager().registerEvents(new LSNAccount(jdbc), plugin);
    }

}
